Student = {}
function MakeStudent (name, gradetab)
    local stu = {}
    stu.name = name
    stu.gradetab = gradetab
    local tempsum = 0
    local ind = 0
    for _,val in pairs(gradetab) do 
        tempsum = tempsum + val 
        ind = ind + 1
    end 
    stu.average = tempsum / ind
    if stu.average > 80 then stu.level = 'a' 
    elseif stu.average > 60 then stu.level = 'b'
    else stu.level = 'd'
    end
    return stu
end

function MakeStudents(size)
    local stulist = {}
    for i = 1, tonumber(size) do
        print("输入姓名：")        
        local tempname = io.read()
        print("语文成绩：")
        local ch = io.read()
        print("英语成绩：")
        local en = io.read()
        local tempgradetab = {yvwen = ch, yingyv = en}
        stulist[i] = MakeStudent(tempname, tempgradetab)
    end
    return stulist
end

function PrintAverage(sl)
    for _,stu in pairs(sl) do
        print("姓名：" .. stu.name.. " 平均分：" .. stu.average  ..  " 等第：" .. stu.level)
    end
end